simulatePop function takes a Genotype-to-Phenotype map (i.e. a vector
defining the genotypic value of all possible genotypes) and
returns a data frame containing the simulated population. drawGenotype
generates a single-individual genotype, and is a sub-routine of
simulatePop.simulatePop(gmap, N = 100, sigmaE = 1, type = "F2", freqmat=NULL)
drawGenotype(nloc = 1, type = "F2", freqmat=NULL)genNames."F2", "Finf", "F1", "UWR", "G2A", and "noia" are possible.type="G2A": A vector of length nloc containing allele frequencies such that
freqmat[i]=frequency(allele 1) for locus i.
For type="noia"$phen) contains the
phenotypes, and the following ones ($Loc1, $loc2, etc) the
genotypes of all individuals.freqmat. "G2A" is the name of the statistical model by Zeng et al. (2005) in which genetic effects estimated from such a population are orthogonal.}
freqmat. "noia" is the name of the statistical model by Alvarez-Castro and Carlborg (2007) in which genetic effects estimated from such a population are orthogonal. In all populations, loci are considered as independent and are at linkage equilibrium.}GPmap, genNamesset.seed(123456789)
map <- c(0.25, -0.75, -0.75, -0.75, 2.25, 2.25, -0.75, 2.25, 2.25)
pop <- simulatePop(map, N=500, sigmaE=0.2, type="F2")
str(pop)
## Create a "noia" population with genotype frequencies 1/3,1/3,1/3 for locus 1
## and 0.2,0.6,0.2 for locus 2
pop = simulatePop(map, N=1000, sigma=1, type='noia',
freqmat=matrix(c(1/3,1/3,1/3,0.2,0.6,0.2),nrow=2, byrow=TRUE))Run the code above in your browser using DataLab